3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ const X = 10; static function dotest(){ $arr = array(0 => 5, 1=>12, 2=>7, 3=>5, 4, 13); $valid = array_filter( $arr, function( $item ){ return ( $item < self::X ); }); var_dump($valid); } } test::dotest();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vjslu
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'test', 'dotest'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fvjslu%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vjslu
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        FETCH_CLASS_CONSTANT                             ~1      'X'
          2        IS_SMALLER                                       ~2      !0, ~1
          3      > RETURN                                                   ~2
   12     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fvjslu%3A10%240

Class test:
Function dotest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vjslu
function name:  dotest
number of ops:  11
compiled vars:  !0 = $arr, !1 = $valid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fvjslu%3A10%240'
   12     4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
   10     6        ASSIGN                                                   !1, $4
   13     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   14    10      > RETURN                                                   null

End of function dotest

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.66 ms | 940 KiB | 18 Q