3v4l.org

run code in 300+ PHP versions simultaneously
<?php // SETUP CODE class A { function __construct($val) { $this->val = $val; } } $objs = [ new A(3), new A(5), new A(2), ]; // AMAZING max_by IMPL :P $res = array_filter($objs, function ($o) { static $m; var_dump($m); $m = max($o->val, $m); return $o->val == $m; }); //print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vUG8m
function name:  (null)
number of ops:  20
compiled vars:  !0 = $objs, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'A'
          1        SEND_VAL_EX                                              3
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~4      $2
   12     4        NEW                                              $5      'A'
          5        SEND_VAL_EX                                              5
          6        DO_FCALL                                      0          
          7        ADD_ARRAY_ELEMENT                                ~4      $5
   13     8        NEW                                              $7      'A'
          9        SEND_VAL_EX                                              2
         10        DO_FCALL                                      0          
         11        ADD_ARRAY_ELEMENT                                ~4      $7
   10    12        ASSIGN                                                   !0, ~4
   17    13        INIT_FCALL                                               'array_filter'
         14        SEND_VAR                                                 !0
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvUG8m%3A17%240'
   22    16        SEND_VAL                                                 ~10
         17        DO_ICALL                                         $11     
   17    18        ASSIGN                                                   !1, $11
   23    19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FvUG8m%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vUG8m
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $o, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        BIND_STATIC                                              !1
   19     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
   20     5        INIT_FCALL                                               'max'
          6        FETCH_OBJ_R                                      ~3      !0, 'val'
          7        SEND_VAL                                                 ~3
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $4      
         10        ASSIGN                                                   !1, $4
   21    11        FETCH_OBJ_R                                      ~6      !0, 'val'
         12        IS_EQUAL                                         ~7      !1, ~6
         13      > RETURN                                                   ~7
   22    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvUG8m%3A17%240

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vUG8m
function name:  __construct
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'val'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.01 ms | 1400 KiB | 19 Q