3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array( 'empty array' => array(), 'consecutive from 0' => array( 0 => 'one', 1 => 'two', ), 'consecutive from 0 float' => array( 0.0 => 'one', 1.0 => 'two', ), 'consecutive from 0 str' => array( '0' => 'one', '1' => 'two', ), 'consecutive from 1' => array( 1 => 'one', 2 => 'two', ), 'consecutive from 1 float' => array( 1.0 => 'one', 2.0 => 'two', ), 'consecutive from 1 str' => array( '1' => 'one', '2' => 'two', ), 'non-consecutive int' => array( 1 => 'one', 0 => 'two', ), 'non-consecutive float' => array( 1.0 => 'one', 0.0 => 'two', ), 'non-consecutive string' => array( '1' => 'one', '0' => 'two', ), ); foreach ( $tests as $test => $arr ) { echo str_pad( $test, 30 ), var_export( array_is_list( $arr ), true ), PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
empty array true consecutive from 0 true consecutive from 0 float true consecutive from 0 str true consecutive from 1 false consecutive from 1 float false consecutive from 1 str false non-consecutive int false non-consecutive float false non-consecutive string false

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:
54.21 ms | 406 KiB | 5 Q