Using Simpletest PHP unit testing for PHP ", receiving the error message" Deprecated: assigning return value new by reference deprecated "

I am new to using simpletest: http://www.simpletest.org/ for PHP and using PHP 5.2 * on my server, when I try to install a script based on their demo after the initial test, I get a page with errors like the one below ... I'm not sure if this is due to the fact that simpletest is incompatible with PHP 5. * or that there is a problem, any understanding is understood .. it seems that I can still use the library, as it returns what seems appropriate below errors, but I would like to understand this so that I can fix it. thank

Here is an example php code that I use to call a simple function

<?php

require_once('C:/wamp/www/external/simpletest/simpletest/autorun.php');


class TestOfLogging extends UnitTestCase {
    function testFirstLogMessagesCreatesFileIfNonexistent() {
        @unlink(dirname(__FILE__) . '/../temp/test.log');
        $log = new Log(dirname(__FILE__) . '/../temp/test.log');
        $log->message('Should write this to a file');
        $this->assertTrue(file_exists(dirname(__FILE__) . '/../temp/test.log'));
    }
}
?>

And the error I get:

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\external\simpletest\simpletest\unit_tester.php  on line 74

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\external\simpletest\simpletest\unit_tester.php on line 89
+3
source share
4 answers

"Deprecated" means that something old is being done that might not be supported by future versions of php. This should not be harmful, but should be taken care of by simple developers. Have you downloaded the latest version of simpletest? If you want to understand, look at unit_tester.php on lines 74 and 89.

+2
source

, , . : "& new" "new". new (&new) PHP5.3, , , SimpleTest.

+1

, 5.2, 5.3, ? , , PEAR 5.3.

0

, .

, display_errors = On php.ini display_errors = Off.

0

Source: https://habr.com/ru/post/1752991/


All Articles