3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DB { var $sql_query = 'update :table_foo set products_price_ek = :products_price_ek, products_price = :products_price'; 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) || ereg('[ ,)"]', $character_after_place_holder)) { $this->sql_query = substr_replace($this->sql_query, $value, $pos, $length); } } } } $obj = new DB; $obj->bindReplace(':products_price', '10.000'); echo $obj->sql_query; ?>
Output for git.master_jit, git.master, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function ereg() in /in/MVtDs:12 Stack trace: #0 /in/MVtDs(20): DB->bindReplace(':products_price', '10.000') #1 {main} thrown in /in/MVtDs on line 12
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.98 ms | 401 KiB | 8 Q