In CLI SAPI extension works fine, but under apache2 I get this message:
Warning: Handler for type "string" already exists, overriding in /var/www/index.php on line 9
Code what I run:
<?php
class StringHandler {
public function length() {
return strlen($this);
}
}
register_primitive_type_handler('string', 'StringHandler');
$str = "hello";
var_dump($str->length());
This bug doesn't appear when I load page first time, but further attempts throw warning.
When I change any line of code, page shows normally again.
In CLI SAPI extension works fine, but under apache2 I get this message:
Warning: Handler for type "string" already exists, overriding in /var/www/index.php on line 9
Code what I run:
This bug doesn't appear when I load page first time, but further attempts throw warning. When I change any line of code, page shows normally again.
Sorry for my bad English.