3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParent { const NAVIGATION = 'nav'; public static function getUri() { static $uri = null; if ($uri === null) { echo 'null<br>'; $uri = 'test '.static::NAVIGATION; } return $uri; } } class FirstChild extends MyParent { } class SecondChild extends MyParent { const NAVIGATION = 'childnav'; } $first = new FirstChild(); $second = new SecondChild(); echo '<pre>', var_export($first->getUri(), true), '</pre>'; echo '<pre>', var_export($second->getUri(), true), '</pre>'; echo '<pre>', var_export($first->getUri(), true), '</pre>'; echo '<pre>', var_export($second->getUri(), true), '</pre>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i94dj
function name:  (null)
number of ops:  43
compiled vars:  !0 = $first, !1 = $second
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $2      'FirstChild'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   29     3        NEW                                              $5      'SecondChild'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   31     6        ECHO                                                     '%3Cpre%3E'
          7        INIT_FCALL                                               'var_export'
          8        INIT_METHOD_CALL                                         !0, 'getUri'
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR                                                 $8
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $9      
         13        ECHO                                                     $9
         14        ECHO                                                     '%3C%2Fpre%3E'
   32    15        ECHO                                                     '%3Cpre%3E'
         16        INIT_FCALL                                               'var_export'
         17        INIT_METHOD_CALL                                         !1, 'getUri'
         18        DO_FCALL                                      0  $10     
         19        SEND_VAR                                                 $10
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $11     
         22        ECHO                                                     $11
         23        ECHO                                                     '%3C%2Fpre%3E'
   33    24        ECHO                                                     '%3Cpre%3E'
         25        INIT_FCALL                                               'var_export'
         26        INIT_METHOD_CALL                                         !0, 'getUri'
         27        DO_FCALL                                      0  $12     
         28        SEND_VAR                                                 $12
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $13     
         31        ECHO                                                     $13
         32        ECHO                                                     '%3C%2Fpre%3E'
   34    33        ECHO                                                     '%3Cpre%3E'
         34        INIT_FCALL                                               'var_export'
         35        INIT_METHOD_CALL                                         !1, 'getUri'
         36        DO_FCALL                                      0  $14     
         37        SEND_VAR                                                 $14
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $15     
         40        ECHO                                                     $15
         41        ECHO                                                     '%3C%2Fpre%3E'
         42      > RETURN                                                   1

Class MyParent:
Function geturi:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/i94dj
function name:  getUri
number of ops:  9
compiled vars:  !0 = $uri
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_STATIC                                              !0
    9     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->7
   11     3    >   ECHO                                                     'null%3Cbr%3E'
   12     4        FETCH_CLASS_CONSTANT                             ~2      'NAVIGATION'
          5        CONCAT                                           ~3      'test+', ~2
          6        ASSIGN                                                   !0, ~3
   14     7    > > RETURN                                                   !0
   15     8*     > RETURN                                                   null

End of function geturi

End of class MyParent.

Class FirstChild:
Function geturi:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/i94dj
function name:  getUri
number of ops:  9
compiled vars:  !0 = $uri
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_STATIC                                              !0
    9     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->7
   11     3    >   ECHO                                                     'null%3Cbr%3E'
   12     4        FETCH_CLASS_CONSTANT                             ~2      'NAVIGATION'
          5        CONCAT                                           ~3      'test+', ~2
          6        ASSIGN                                                   !0, ~3
   14     7    > > RETURN                                                   !0
   15     8*     > RETURN                                                   null

End of function geturi

End of class FirstChild.

Class SecondChild:
Function geturi:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/i94dj
function name:  getUri
number of ops:  9
compiled vars:  !0 = $uri
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_STATIC                                              !0
    9     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->7
   11     3    >   ECHO                                                     'null%3Cbr%3E'
   12     4        FETCH_CLASS_CONSTANT                             ~2      'NAVIGATION'
          5        CONCAT                                           ~3      'test+', ~2
          6        ASSIGN                                                   !0, ~3
   14     7    > > RETURN                                                   !0
   15     8*     > RETURN                                                   null

End of function geturi

End of class SecondChild.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.42 ms | 1400 KiB | 15 Q