3v4l.org

run code in 300+ PHP versions simultaneously
<?php header("Content-type: text/plain charset=UTF-8;"); $in = array( 'meta_data' => 'querysucceful!', 'size' => 15, 'resultset'=> array( array( 'name' => 'resul_1', array(array(array(array(1)))), 'aaaa' => '1a', 'bbbb' => '1b' ), array( 'name' => 'result_2', 'aaaa' => '2a', 'bbbb' => '2b' ), array( 'name' => 'result_3', 'aaaa' => '3a', 'bbbb' => '3b' ) ) ); $filter = array( 'meta_data' => FILTER_SANITIZE_STRING, 'size' => FILTER_SANITIZE_NUMBER_INT, 'resultset' => array('filter' => FILTER_CALLBACK, 'options' => 'filter_result') ); $out = filter_var_array($in, $filter); var_dump($out); function filter_result($result) { var_dump($result); return null; }
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /in/0fDGI on line 31 string(7) "resul_1" string(1) "1" string(2) "1a" string(2) "1b" string(8) "result_2" string(2) "2a" string(2) "2b" string(8) "result_3" string(2) "3a" string(2) "3b" array(3) { ["meta_data"]=> string(14) "querysucceful!" ["size"]=> string(2) "15" ["resultset"]=> array(3) { [0]=> array(4) { ["name"]=> NULL [0]=> array(1) { [0]=> array(1) { [0]=> array(1) { [0]=> array(1) { [0]=> NULL } } } } ["aaaa"]=> NULL ["bbbb"]=> NULL } [1]=> array(3) { ["name"]=> NULL ["aaaa"]=> NULL ["bbbb"]=> NULL } [2]=> array(3) { ["name"]=> NULL ["aaaa"]=> NULL ["bbbb"]=> NULL } } }
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.21, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
string(7) "resul_1" string(1) "1" string(2) "1a" string(2) "1b" string(8) "result_2" string(2) "2a" string(2) "2b" string(8) "result_3" string(2) "3a" string(2) "3b" array(3) { ["meta_data"]=> string(14) "querysucceful!" ["size"]=> string(2) "15" ["resultset"]=> array(3) { [0]=> array(4) { ["name"]=> NULL [0]=> array(1) { [0]=> array(1) { [0]=> array(1) { [0]=> array(1) { [0]=> NULL } } } } ["aaaa"]=> NULL ["bbbb"]=> NULL } [1]=> array(3) { ["name"]=> NULL ["aaaa"]=> NULL ["bbbb"]=> NULL } [2]=> array(3) { ["name"]=> NULL ["aaaa"]=> NULL ["bbbb"]=> NULL } } }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Notice: Use of undefined constant FILTER_SANITIZE_STRING - assumed 'FILTER_SANITIZE_STRING' in /in/0fDGI on line 31 Notice: Use of undefined constant FILTER_SANITIZE_NUMBER_INT - assumed 'FILTER_SANITIZE_NUMBER_INT' in /in/0fDGI on line 32 Notice: Use of undefined constant FILTER_CALLBACK - assumed 'FILTER_CALLBACK' in /in/0fDGI on line 33 Fatal error: Call to undefined function filter_var_array() in /in/0fDGI on line 36
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Use of undefined constant FILTER_SANITIZE_STRING - assumed 'FILTER_SANITIZE_STRING' in /in/0fDGI on line 31 Notice: Use of undefined constant FILTER_SANITIZE_NUMBER_INT - assumed 'FILTER_SANITIZE_NUMBER_INT' in /in/0fDGI on line 32 Notice: Use of undefined constant FILTER_CALLBACK - assumed 'FILTER_CALLBACK' in /in/0fDGI on line 33 Fatal error: Call to undefined function: filter_var_array() in /in/0fDGI on line 36
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Notice: Use of undefined constant FILTER_SANITIZE_STRING - assumed 'FILTER_SANITIZE_STRING' in /in/0fDGI on line 31 Notice: Use of undefined constant FILTER_SANITIZE_NUMBER_INT - assumed 'FILTER_SANITIZE_NUMBER_INT' in /in/0fDGI on line 32 Notice: Use of undefined constant FILTER_CALLBACK - assumed 'FILTER_CALLBACK' in /in/0fDGI on line 33 Fatal error: Call to undefined function: filter_var_array() in /in/0fDGI on line 36
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant FILTER_SANITIZE_STRING - assumed 'FILTER_SANITIZE_STRING' in /in/0fDGI on line 31 Notice: Use of undefined constant FILTER_SANITIZE_NUMBER_INT - assumed 'FILTER_SANITIZE_NUMBER_INT' in /in/0fDGI on line 32 Notice: Use of undefined constant FILTER_CALLBACK - assumed 'FILTER_CALLBACK' in /in/0fDGI on line 33 Fatal error: Call to undefined function: filter_var_array() in /in/0fDGI on line 36

preferences:
242.07 ms | 402 KiB | 314 Q