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(filtro($projetos));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T50hL
function name:  (null)
number of ops:  8
compiled vars:  !0 = $projetos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   42     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'filtro'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function filtro:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/T50hL
function name:  filtro
number of ops:  14
compiled vars:  !0 = $projetos, !1 = $projetosFiltrados, !2 = $projeto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ASSIGN                                                   !1, <array>
   23     2      > FE_RESET_R                                       $4      !0, ->11
          3    > > FE_FETCH_R                                               $4, !2, ->11
   24     4    >   FETCH_DIM_R                                      ~5      !2, 'title'
          5        IS_SMALLER                                               ~5, 2025
          6      > JMPZ                                                     ~6, ->10
   25     7    >   FETCH_DIM_R                                      ~8      !2, ''
          8        ASSIGN_DIM                                               !1
          9        OP_DATA                                                  ~8
   23    10    > > JMP                                                      ->3
         11    >   FE_FREE                                                  $4
   29    12      > RETURN                                                   !1
   30    13*     > RETURN                                                   null

End of function filtro

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.53 ms | 1008 KiB | 15 Q