3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NumberReturner { private $nums; public function __construct($nums) { $this->nums = $nums; } public function resolve() { return $this->nums; } } $objs = [new NumberReturner([1, 2, 3, 4]), new NumberReturner([1, 2, 5, 6]), new NumberReturner([1, 2, 6])]; $result = array_shift($objs)->resolve(); foreach ($objs as $obj) { $result = array_intersect($obj->resolve()); } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/dI75N
function name:  (null)
number of ops:  33
compiled vars:  !0 = $objs, !1 = $result, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $3      'NumberReturner'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~5      $3
          4        NEW                                              $6      'NumberReturner'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
          7        ADD_ARRAY_ELEMENT                                ~5      $6
          8        NEW                                              $8      'NumberReturner'
          9        SEND_VAL_EX                                              <array>
         10        DO_FCALL                                      0          
         11        ADD_ARRAY_ELEMENT                                ~5      $8
         12        ASSIGN                                                   !0, ~5
   20    13        INIT_FCALL                                               'array_shift'
         14        SEND_REF                                                 !0
         15        DO_ICALL                                         $11     
         16        INIT_METHOD_CALL                                         $11, 'resolve'
         17        DO_FCALL                                      0  $12     
         18        ASSIGN                                                   !1, $12
   21    19      > FE_RESET_R                                       $14     !0, ->28
         20    > > FE_FETCH_R                                               $14, !2, ->28
   22    21    >   INIT_FCALL                                               'array_intersect'
         22        INIT_METHOD_CALL                                         !2, 'resolve'
         23        DO_FCALL                                      0  $15     
         24        SEND_VAR                                                 $15
         25        DO_ICALL                                         $16     
         26        ASSIGN                                                   !1, $16
   21    27      > JMP                                                      ->20
         28    >   FE_FREE                                                  $14
   25    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

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

End of function __construct

Function resolve:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dI75N
function name:  resolve
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'nums'
          1      > RETURN                                                   ~0
   15     2*     > RETURN                                                   null

End of function resolve

End of class NumberReturner.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.08 ms | 1400 KiB | 19 Q