3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const BAR = 30; public function __construct() { $time = 1377176743; $array = array( 1377176711, 1377176712, 1377176714, 1377176717, ); array_filter($array, function($value) use ($time) { echo "evaluating $value against $time and " . static::BAR . "\n"; var_dump($value, $time - static::BAR, $value >= $time - static::BAR); return $value >= $time - static::BAR; }); var_dump($array); } } new Foo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CQk41
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FCQk41%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CQk41
function name:  {closure}
number of ops:  26
compiled vars:  !0 = $value, !1 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   19     2        ROPE_INIT                                     5  ~3      'evaluating+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '+against+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '+and+'
          7        FETCH_CLASS_CONSTANT                             ~6      'BAR'
          8        CONCAT                                           ~7      ~2, ~6
          9        CONCAT                                           ~8      ~7, '%0A'
         10        ECHO                                                     ~8
   20    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        FETCH_CLASS_CONSTANT                             ~9      'BAR'
         14        SUB                                              ~10     !1, ~9
         15        SEND_VAL                                                 ~10
         16        FETCH_CLASS_CONSTANT                             ~11     'BAR'
         17        SUB                                              ~12     !1, ~11
         18        IS_SMALLER_OR_EQUAL                              ~13     ~12, !0
         19        SEND_VAL                                                 ~13
         20        DO_ICALL                                                 
   21    21        FETCH_CLASS_CONSTANT                             ~15     'BAR'
         22        SUB                                              ~16     !1, ~15
         23        IS_SMALLER_OR_EQUAL                              ~17     ~16, !0
         24      > RETURN                                                   ~17
   22    25*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FCQk41%3A18%240

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CQk41
function name:  __construct
number of ops:  12
compiled vars:  !0 = $time, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 1377176743
   11     1        ASSIGN                                                   !1, <array>
   18     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCQk41%3A18%240'
          5        BIND_LEXICAL                                             ~4, !0
   22     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   25     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   26    11      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.3 ms | 1400 KiB | 17 Q