3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { var $job = "person"; function show_job() { echo "Hi, I work as a {$this->job}."; } } class Bartender { var $job = "bartender"; function show_job() { echo "BARTENDER: "; Person::show_job(); } } $b = new Bartender; $b->show_job();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VdNXh
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'Bartender'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3        INIT_METHOD_CALL                                         !0, 'show_job'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Person:
Function show_job:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VdNXh
function name:  show_job
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ROPE_INIT                                     3  ~2      'Hi%2C+I+work+as+a+'
          1        FETCH_OBJ_R                                      ~0      'job'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '.'
          4        ECHO                                                     ~1
    7     5      > RETURN                                                   null

End of function show_job

End of class Person.

Class Bartender:
Function show_job:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VdNXh
function name:  show_job
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'BARTENDER%3A+'
          1        INIT_STATIC_METHOD_CALL                                  'Person', 'show_job'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   null

End of function show_job

End of class Bartender.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.54 ms | 1394 KiB | 13 Q