3v4l.org

run code in 300+ PHP versions simultaneously
<?php $status_key ="status"; $response = '{"error":false,"data":{"id":16420728,"order_id":"5000","mobile_no":"9995088810","amount":20,"balance":46.89,"status":"failure","tnx_id":"","response":"Transaction Failed"}}'; $result = json_decode($response); print_r($result); var_dump(array_key_exists($status_key,$result->data));
Output for git.master, git.master_jit, rfc.property-hooks
stdClass Object ( [error] => [data] => stdClass Object ( [id] => 16420728 [order_id] => 5000 [mobile_no] => 9995088810 [amount] => 20 [balance] => 46.89 [status] => failure [tnx_id] => [response] => Transaction Failed ) ) Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, stdClass given in /in/uWB7s:10 Stack trace: #0 {main} thrown in /in/uWB7s on line 10
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:
33.04 ms | 406 KiB | 5 Q