3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1.5 => "rate", false => "hood", true => "love", "2" => "late", 4 => "site"); $del = function ( $array, $key ) { unset( $array[ $key ] ); return array_values( $array ); }; $seek = "hood"; if ( ( $dex = array_search( $seek, $arr ) ) === false) { $arr = $del( $arr, $dex ); } var_dump($arr); //[1 => "love", 0 => “hood”, 2 => "late", 4 => ”site”]
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 1.5 to int loses precision in /in/YnTnJ on line 3 array(4) { [1]=> string(4) "love" [0]=> string(4) "hood" [2]=> string(4) "late" [4]=> string(4) "site" }

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:
30.36 ms | 401 KiB | 8 Q