3v4l.org

run code in 300+ PHP versions simultaneously
<?php class weird{ public static function iamstatic($calledFrom){ echo "I am a static function called with a $calledFrom operator\n"; } public function test(){ self::iamstatic("static"); $this->iamstatic("dynamic"); } } $c = new weird(); $c->test(); weird::iamstatic("Static outside class"); $c->iamstatic("Dynamic outside class");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/14PYp
function name:  (null)
number of ops:  12
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'weird'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
   19     5        INIT_STATIC_METHOD_CALL                                  'weird', 'iamstatic'
          6        SEND_VAL                                                 'Static+outside+class'
          7        DO_FCALL                                      0          
   20     8        INIT_METHOD_CALL                                         !0, 'iamstatic'
          9        SEND_VAL_EX                                              'Dynamic+outside+class'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class weird:
Function iamstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/14PYp
function name:  iamstatic
number of ops:  6
compiled vars:  !0 = $calledFrom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ROPE_INIT                                     3  ~2      'I+am++a+static+function+called+with++a+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '+operator%0A'
          4        ECHO                                                     ~1
    7     5      > RETURN                                                   null

End of function iamstatic

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/14PYp
function name:  test
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_STATIC_METHOD_CALL                                  'iamstatic'
          1        SEND_VAL                                                 'static'
          2        DO_FCALL                                      0          
   11     3        INIT_METHOD_CALL                                         'iamstatic'
          4        SEND_VAL_EX                                              'dynamic'
          5        DO_FCALL                                      0          
   12     6      > RETURN                                                   null

End of function test

End of class weird.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.68 ms | 1395 KiB | 13 Q