3v4l.org

run code in 300+ PHP versions simultaneously
<?php $customer = new stdClass(); $customer->{"first-name"} = "NAME"; $customer->{"last-name"} = "NAME"; $customer->{"phone-numer"} = "NUMBER"; print_r($customer); foreach (get_object_vars($customer) as $key => $value) { $key2 = str_replace('-', '_', $key); $customer->$key2 = $customer->$key; unset($customer->$key); } print_r($customer);
Output for git.master, git.master_jit, rfc.property-hooks
stdClass Object ( [first-name] => NAME [last-name] => NAME [phone-numer] => NUMBER ) stdClass Object ( [first_name] => NAME [last_name] => NAME [phone_numer] => NUMBER )

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:
92.77 ms | 405 KiB | 5 Q