3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); $key = 'd'; if( array_key_exists( $key, $data )): $pos = array_search( array_keys( $key, $data ) ); $start = array_slice( $data, 0, $pos ); $end = array_slice( $data, $pos, count( $data ) ); $data = array_merge( $start, array( null ), $end ); endif; var_dump( $data );
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in /in/CAtWO:5 Stack trace: #0 /in/CAtWO(5): array_keys('d', Array) #1 {main} thrown in /in/CAtWO on line 5
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:
49.9 ms | 401 KiB | 8 Q