3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const WEB_NAME = 'web name'; public function __invoke() { $templateName = 'web'; $templateName = strtoupper($templateName) . '_NAME'; $templateName = self::$templateName; return $templateName; } } $a = new Foo; echo $a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4sUjh
function name:  (null)
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        ECHO                                                     !0
          4      > RETURN                                                   1

Class Foo:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4sUjh
function name:  __invoke
number of ops:  10
compiled vars:  !0 = $templateName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'web'
   11     1        INIT_FCALL                                               'strtoupper'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        CONCAT                                           ~3      $2, '_NAME'
          5        ASSIGN                                                   !0, ~3
   12     6        FETCH_STATIC_PROP_R          global lock         ~5      'templateName'
          7        ASSIGN                                                   !0, ~5
   14     8      > RETURN                                                   !0
   15     9*     > RETURN                                                   null

End of function __invoke

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.97 ms | 1395 KiB | 15 Q