3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Evil { public $info = ['data', 'I', 'want', 'to', 'add', 'to']; public function getInfo() { return $this->info; } } class Human { use Evil; public function getInfo() { $data = Evil::getInfo(); return $data + ['and', 'I', 'think', 'I', 'did']; } } var_dump((new Human)->getInfo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7IEoC
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'human'
   18     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'Human'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getInfo'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Evil:
Function getinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7IEoC
function name:  getInfo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_OBJ_R                                      ~0      'info'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getinfo

End of class Evil.

Class Human:
Function getinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7IEoC
function name:  getInfo
number of ops:  6
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                  'Evil', 'getInfo'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   14     3        ADD                                              ~3      !0, <array>
          4      > RETURN                                                   ~3
   15     5*     > RETURN                                                   null

End of function getinfo

End of class Human.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.2 ms | 1395 KiB | 15 Q