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($lista){ $projetosFiltrados = []; foreach($lista as $projeto){ if($projeto["title"] < 2024){ $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"); // }); $resultado = filtro($projetos); var_dump($resultado);
Output for git.master, git.master_jit
array(0) { }

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:
35.02 ms | 405 KiB | 5 Q