3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php # EXEMPLO VIRID # Define os IDs de listas $listas = array(); $listas[] = array("listaId" => 102); $listas[] = array("listaId" => 443); echo '<pre>'; print_r($listas); echo '<pre>' . PHP_EOL; # EXEMPLO 3YZ $params = array( 'login' => $ws_user, 'senha' => $ws_password, 'email' => 'joel.souza@gmail.com', 'nome' => 'joel', 'nascimento' => NULL, 'celular' => NULL, 'listas' => array(array('listaId' => 10)), 'camposadicionais' => NULL ); echo '<pre>'; print_r($params['listas']); echo '<pre>' . PHP_EOL;
Output for 5.0.4 - 7.1.0
<pre>Array ( [0] => Array ( [listaId] => 102 ) [1] => Array ( [listaId] => 443 ) ) <pre> Notice: Undefined variable: ws_user in /in/AlXmg on line 18 Notice: Undefined variable: ws_password in /in/AlXmg on line 19 <pre>Array ( [0] => Array ( [listaId] => 10 ) ) <pre>
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.0.3
<pre>Array ( [0] => Array ( [listaId] => 102 ) [1] => Array ( [listaId] => 443 ) ) <pre> Notice: Undefined variable: ws_user in /in/AlXmg on line 18 Notice: Undefined variable: ws_password in /in/AlXmg on line 19 <pre>Array ( [0] => Array ( [listaId] => 10 ) ) <pre>
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
<pre>Array ( [0] => Array ( [listaId] => 102 ) [1] => Array ( [listaId] => 443 ) ) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AlXmg on line 12 <pre>PHP_EOL Notice: Undefined variable: ws_user in /in/AlXmg on line 18 Notice: Undefined variable: ws_password in /in/AlXmg on line 19 <pre>Array ( [0] => Array ( [listaId] => 10 ) ) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AlXmg on line 31 <pre>PHP_EOL