php-7.3

What is wrong with this example of class inheritance? [duplicate]

家住魔仙堡 提交于 2020-01-30 09:14:08
问题 This question already has answers here : Override method parameter with child interface as a new parameter (2 answers) Abstract function parameter type hint overriding in PHP 7 (2 answers) Closed 4 months ago . This code of dependency inversion should work fine but instead it gives error. What am I doing wrong in here? interface A { } abstract class B implements A { } class C extends B { } abstract class D { public function foo(A $a) { } } class E extends D { public function foo(C $c) { } }

Difference in matching end of line with PHP regex

℡╲_俬逩灬. 提交于 2020-01-11 09:18:11
问题 Given the code: $my_str = ' Rollo is* My dog* And he\'s very* Lovely* '; preg_match_all('/\S+(?=\*$)/m', $my_str, $end_words); print_r($end_words); In PHP 7.3.2 (XAMPP) I get the unexpected output Array ( [0] => Array ( ) ) Whereas in PHPFiddle, on PHP 7.0.33, I get what I expected: Array ( [0] => Array ( [0] => is [1] => dog [2] => very [3] => Lovely ) ) Can anyone tell me why I'm getting this difference, whether something changed in REGEX behaviour after 7.0.33? 回答1: It seems that in the

how to send mail with phpmailer class?

我们两清 提交于 2020-01-11 07:13:13
问题 I created a phpMailer class and call it into my register.php file all fine. But dont find a way how to send emails from class. Here is my class: class mailSend { public function sendMail($email, $message, $subject) { require_once('PHPMailer/src/Exception.php'); require_once('PHPMailer/src/PHPMailer.php'); require_once('PHPMailer/src/SMTP.php'); $mail = new PHPMailer\PHPMailer\PHPMailer(); try { $mail->SMTPDebug = 0; $mail->isSMTP(); $mail->Host = "smtp.gmail.com"; $mail->SMTPAuth = true;

how to send mail with phpmailer class?

一曲冷凌霜 提交于 2020-01-11 07:13:01
问题 I created a phpMailer class and call it into my register.php file all fine. But dont find a way how to send emails from class. Here is my class: class mailSend { public function sendMail($email, $message, $subject) { require_once('PHPMailer/src/Exception.php'); require_once('PHPMailer/src/PHPMailer.php'); require_once('PHPMailer/src/SMTP.php'); $mail = new PHPMailer\PHPMailer\PHPMailer(); try { $mail->SMTPDebug = 0; $mail->isSMTP(); $mail->Host = "smtp.gmail.com"; $mail->SMTPAuth = true;

Problems with pthreads in PHP

只愿长相守 提交于 2019-12-23 01:21:26
问题 I have a problem with pthreads in PHP. When I start apache I see error like this: php.exe - Entry point not found The procedure entry point was not found _zend_hash_update@@12 in library D:\xampp\php\ext\php_pthreads.dll When I execute script in CMD I have a warning: PHP Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: D:\xampp\php\ext\php_pthreads.dll I copied pthreadVC2.dll to: C:/windows/system32 D:/xampp/php D:/xampp/apache/bin And I copied last file php

error when removing CSS comments via REGEX

社会主义新天地 提交于 2019-12-22 06:44:22
问题 turns out that both of these sequences (previously working) "`([\n\A;]+)\/\*(.+?)\*\/`ism" => "$1", // error "`([\n\A;\s]+)//(.+?)[\n\r]`ism" =>"$1\n", // error Now throw an error in PHP 7.3 Warning: preg_replace(): Compilation failed: escape sequence is invalid in character class offset 4 CONTEXT: consider this snipit, which removes CSS comments from a string $buffer = ".selector {color:#fff; } /* some comment to remove*/"; $regex = array( "`^([\t\s]+)`ism"=>'', "`^\/\*(.+?)\*\/`ism"=>"", "`

PHP Warning: Use of undefined constant PASSWORD_ARGON2ID when using password_hash() in php 7.3

萝らか妹 提交于 2019-12-12 11:35:15
问题 I recently installed PHP 7.3.6 through Plesk's web GUI for a development copy of a web app, as I intend to update our production environment from php 7.0 to 7.3. I decided to take the opportunity to upgrade our password hashing from PBKDF2 to Argon2ID since the PHP core has it already included. I was surprised to get a warning stating that the PASSWORD_ARGON2ID constant is undefined, since I understand it was added in php 7.3.0. I tried searching for any instance of this error and the only