dizews / php-ubjson

Universal Binary JSON for PHP
9 stars 7 forks source link

PHP 5.6 strict standards error #2

Closed andig closed 9 years ago

andig commented 9 years ago

Error:

PHP Strict standards:  Only variables should be passed by reference in UBJSON.php on line 144

Problem: _encodeString calls

$result = $prefix.$this->_encodeNumeric(strlen($string)).$string;

while _encodeNumeric expects a variable:

protected function _encodeNumeric(&$numeric) {
dizews commented 9 years ago

Hello, thanks for your submmit. currently I have not enough time to fix it. It will be a good if you send a pull request.

dizews commented 9 years ago

@andig, by the last changes encodeNumeric doesn't receive parameters by reference. does the script work well?

dizews commented 9 years ago

not answered. closed it.

andig commented 9 years ago

Should be ok as the reference has been removed. Please note: imho references in PHP should not be used as a measure to improve performance. As far as I know copy-on-write is already used in later php versions.

dizews commented 9 years ago

thanks. honestly I do not remember why I have done this.