3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class DB { public $sql_query = 'update :table_foo set products_price = :products_price, products_price_ek = :products_price_ek'; function bindReplace($place_holder, $value) { $pos = strpos($this->sql_query, $place_holder); if ($pos !== false) { $length = strlen($place_holder); $character_after_place_holder = substr($this->sql_query, $pos+$length, 1); if (($character_after_place_holder === false) || preg_match('/[ ,)"]/', $character_after_place_holder)) { $this->sql_query = substr_replace($this->sql_query, $value, $pos, $length); } } } } $obj = new DB $obj->bindReplace(':products_price', '10.000'); ?>
Output for 5.4.0 - 5.5.6
Parse error: syntax error, unexpected '$obj' (T_VARIABLE) in /in/2XU2M on line 20
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/2XU2M on line 20
Process exited with code 255.