3v4l.org

run code in 300+ PHP versions simultaneously
<?php // http://3v4l.org/ // http://sandbox.onlinephpfunctions.com/ function echo_table($arr_validate){ ?><table><?php foreach ($arr_validate as $keyO => $valueO) { ?><tr><?php ?><td><?php echo '<h5>', $keyO, '</h5>'; ?></td><?php ?></tr><?php ?><tr><?php ?><th>FLAG(S)--></th><?php foreach ($arr_validate[$keyO]['flags'] as $keyF => $valueF) { ?><th colspan="1"><?php echo $keyF; ?></th><?php } ?></tr><?php foreach ($arr_validate[$keyO]['values'] as $keyI => $valueI) { ?><tr><?php ?><td><?php echo var_dump($valueI); // echo gettype($valueI); // echo $keyI; foreach ($arr_validate[$keyO]['flags'] as $keyF => $valueF) { ?></td><td><?php $tmp = filter_var($valueI, $arr_validate[$keyO]['id'], $valueF); var_dump($tmp); // if ($tmp === true) { // echo 'true'; // } else if ($tmp === false) { // echo 'false'; // } else if ($tmp === null) { // echo 'null'; // } else { // echo $tmp; // }; // echo gettype($tmp); } ?></td><?php ?></tr><?php } } ?></table><?php } /* @var $this SiteController */ echo 'ini_get(\'filter.default\'): >>'.ini_get('filter.default').'<<, type: '.gettype(ini_get('filter.default')); echo '<br />'; echo 'ini_get(\'filter.default_flags\'): >>'.ini_get('filter.default_flags').'<<, type: '.gettype(ini_get('filter.default_flags')); echo '<br />'; if (ini_get('filter.default_flags') === false) { echo 'ini_get(\'filter.default_flags\'): false'; }; if (ini_get('filter.default_flags') === true) { echo 'ini_get(\'filter.default_flags\'): true'; }; $arr_validate = array( 'FILTER_VALIDATE_BOOLEAN' => array( 'id' => FILTER_VALIDATE_BOOLEAN, 'flags' => array('nothing' => '', 'FILTER_NULL_ON_FAILURE' => FILTER_NULL_ON_FAILURE), 'values' => array('1'=>1, 'true'=>true, '\'1\''=>'1', '\'true\''=>'true', '\'on\''=>'on', '\'yes\''=>'yes', '0'=>0, 'false'=>false, '\'0\''=>'0', '\'false\''=>'false', '\'off\''=>'off', '\'no\''=>'no', '\'\''=>'', 'null'=>null, '\'null\''=>'null', '\'-0\''=>'-0', '\'+0\''=>'+0', '2'=>2, '-1'=>-1), ), 'FILTER_VALIDATE_EMAIL' => array( 'id' => FILTER_VALIDATE_EMAIL, 'flags' => array('nothing' => ''), 'values' => array( '1@1.1', '1@localhost', '1@nemjo', '1nemjo', ) ), 'FILTER_VALIDATE_FLOAT' => array( 'id' => FILTER_VALIDATE_FLOAT, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_INT' => array( 'id' => FILTER_VALIDATE_INT, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_IP' => array( 'id' => FILTER_VALIDATE_IP, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_REGEXP' => array( 'id' => FILTER_VALIDATE_REGEXP, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_URL' => array( 'id' => FILTER_VALIDATE_URL, 'flags' => array('nothing' => '', ), 'values' => array(), ), ); foreach ($arr_validate as $key => $value) { echo_table(array($key => $value)); }
Output for git.master, git.master_jit, rfc.property-hooks
ini_get('filter.default'): >>unsafe_raw<<, type: string<br />ini_get('filter.default_flags'): >><<, type: string<br /><table><tr><td><h5>FILTER_VALIDATE_BOOLEAN</h5></td></tr><tr><th>FLAG(S)--></th><th colspan="1">nothing</th><th colspan="1">FILTER_NULL_ON_FAILURE</th></tr><tr><td>int(1) </td><td> Fatal error: Uncaught TypeError: filter_var(): Argument #3 ($options) must be of type array|int, string given in /in/BlfuV:28 Stack trace: #0 /in/BlfuV(28): filter_var(1, 258, '') #1 /in/BlfuV(104): echo_table(Array) #2 {main} thrown in /in/BlfuV on line 28
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:
37.3 ms | 402 KiB | 8 Q