3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function test() { $self = $this; $t = function($var) { return ($this->hello($var)); }; $arr = array(true, false, true, false); $arr = array_filter($arr, $t); var_dump($arr); } public function hello($b) { return $b; } } $obj = new Test(); $obj->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UN6PB
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FUN6PB%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UN6PB
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_THIS                                       $1      
          2        INIT_METHOD_CALL                                         $1, 'hello'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
    7     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUN6PB%3A5%240

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

End of function test

Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UN6PB
function name:  hello
number of ops:  3
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1      > RETURN                                                   !0
   14     2*     > RETURN                                                   null

End of function hello

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.68 ms | 1400 KiB | 17 Q