3v4l.org

run code in 300+ PHP versions simultaneously
<?php $node = (object) array( 'nid' => 5, ); $data = array( 'subject' => 'subject', 'content' => 'Some string', ); // For some cases rewrite the content if ($node->nid > 5) { $content = $data['content'] . '<ul><li>List</li><li>with</li><li>some</li><li>items</li>'; $data['content'] = array( 'markup' => $content, '#attached' => array( 'js' => array( 'some_file.js', ), ), ); } if (!array_key_exists('markup', $data['content'])) { $data['content'] = array( 'markup' => $data['content'], ); } print_r($data); // Really? var_dump($data['content']['markup']);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in /in/S8Av5:26 Stack trace: #0 {main} thrown in /in/S8Av5 on line 26
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:
44.66 ms | 401 KiB | 8 Q