3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StaticExample { protected $thingyMoBobber = "Bob"; protected static $thing = "eh!"; public static $castles = "sand castles :3"; public static function playWithThing() { echo self::$thing; } public function heyBob() { echo "hey " . $this->thingyMoBobber; } public static function tryToDoBadThingsWithBob() { echo $this->thingyMoBobber; } } StaticExample::playWithThing(); echo StaticExample::$castles; $staticExample = new StaticExample(); $staticExample->heyBob(); // THESE DO NOT WORK StaticExample::heyBob(); StaticExample::tryToDoBadThingsWithBob();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Ajbc
function name:  (null)
number of ops:  14
compiled vars:  !0 = $staticExample
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'StaticExample', 'playWithThing'
          1        DO_FCALL                                      0          
   22     2        FETCH_STATIC_PROP_R          unknown             ~2      'castles'
          3        ECHO                                                     ~2
   23     4        NEW                                              $3      'StaticExample'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   24     7        INIT_METHOD_CALL                                         !0, 'heyBob'
          8        DO_FCALL                                      0          
   28     9        INIT_STATIC_METHOD_CALL                                  'StaticExample', 'heyBob'
         10        DO_FCALL                                      0          
   29    11        INIT_STATIC_METHOD_CALL                                  'StaticExample', 'tryToDoBadThingsWithBob'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class StaticExample:
Function playwiththing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Ajbc
function name:  playWithThing
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'thing'
          1        ECHO                                                     ~0
   10     2      > RETURN                                                   null

End of function playwiththing

Function heybob:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Ajbc
function name:  heyBob
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'thingyMoBobber'
          1        CONCAT                                           ~1      'hey+', ~0
          2        ECHO                                                     ~1
   14     3      > RETURN                                                   null

End of function heybob

Function trytodobadthingswithbob:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Ajbc
function name:  tryToDoBadThingsWithBob
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'thingyMoBobber'
          2        ECHO                                                     ~1
   18     3      > RETURN                                                   null

End of function trytodobadthingswithbob

End of class StaticExample.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.13 ms | 1395 KiB | 13 Q