3v4l.org

run code in 300+ PHP versions simultaneously
<?php $projetos = [ [ "title" => "PHP - O começo", "ano" => 2024, ], [ "title" => "JavaScript - o fim", "ano" => 2020, ], [ "title" => "HTML - O MEIO", "ano" => 2025, ], ]; function filtro($projetos){ $projetosFiltrados = []; foreach($projetos as $projeto){ if($projeto["title"] < 2025){ $projetosFiltrados [] = $projeto; }; }; return $projetosFiltrados; }; // $before25 = array_filter($projetos, function($projeto){ // return $projeto["ano"] <= 2024; // }); // $containsJS = array_filter($before25, function($projeto){ // return str_contains($projeto["title"], "JavaScript"); // }); var_dump();
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.15, 8.5.0
Fatal error: Uncaught ArgumentCountError: var_dump() expects at least 1 argument, 0 given in /in/roD3V:42 Stack trace: #0 /in/roD3V(42): var_dump() #1 {main} thrown in /in/roD3V on line 42
Process exited with code 255.

preferences:
51.67 ms | 406 KiB | 5 Q