3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Bar; class A { } class B { public function __construct($type) { $fullType = 'Foo\\Bar\\' . $type; echo "try to create $fullType\n"; new $fullType; echo "$fullType created\n"; $fullType = get_class($type . '::class'); echo "try to create $type::class ($fullType)\n"; new $fullType; echo "$type::class ($fullType) created\n"; echo "try to create $type\n"; new $type; echo "$type created\n"; } } new A; new B('A');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMs9i
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $0      'Foo%5CBar%5CA'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
   31     3        NEW                                              $2      'Foo%5CBar%5CB'
          4        SEND_VAL_EX                                              'A'
          5        DO_FCALL                                      0          
          6        FREE                                                     $2
          7      > RETURN                                                   1

Class Foo\Bar\A: [no user functions]
Class Foo\Bar\B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMs9i
function name:  __construct
number of ops:  46
compiled vars:  !0 = $type, !1 = $fullType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        CONCAT                                           ~2      'Foo%5CBar%5C', !0
          2        ASSIGN                                                   !1, ~2
   15     3        ROPE_INIT                                     3  ~5      'try+to+create+'
          4        ROPE_ADD                                      1  ~5      ~5, !1
          5        ROPE_END                                      2  ~4      ~5, '%0A'
          6        ECHO                                                     ~4
   16     7        FETCH_CLASS                                   0  $7      !1
          8        NEW                                              $8      $7
          9        DO_FCALL                                      0          
         10        FREE                                                     $8
   17    11        NOP                                                      
         12        FAST_CONCAT                                      ~10     !1, '+created%0A'
         13        ECHO                                                     ~10
   19    14        INIT_NS_FCALL_BY_NAME                                    'Foo%5CBar%5Cget_class'
         15        CONCAT                                           ~11     !0, '%3A%3Aclass'
         16        SEND_VAL_EX                                              ~11
         17        DO_FCALL                                      0  $12     
         18        ASSIGN                                                   !1, $12
   20    19        ROPE_INIT                                     5  ~15     'try+to+create+'
         20        ROPE_ADD                                      1  ~15     ~15, !0
         21        ROPE_ADD                                      2  ~15     ~15, '%3A%3Aclass+%28'
         22        ROPE_ADD                                      3  ~15     ~15, !1
         23        ROPE_END                                      4  ~14     ~15, '%29%0A'
         24        ECHO                                                     ~14
   21    25        FETCH_CLASS                                   0  $18     !1
         26        NEW                                              $19     $18
         27        DO_FCALL                                      0          
         28        FREE                                                     $19
   22    29        ROPE_INIT                                     4  ~22     !0
         30        ROPE_ADD                                      1  ~22     ~22, '%3A%3Aclass+%28'
         31        ROPE_ADD                                      2  ~22     ~22, !1
         32        ROPE_END                                      3  ~21     ~22, '%29+created%0A'
         33        ECHO                                                     ~21
   24    34        ROPE_INIT                                     3  ~25     'try+to+create+'
         35        ROPE_ADD                                      1  ~25     ~25, !0
         36        ROPE_END                                      2  ~24     ~25, '%0A'
         37        ECHO                                                     ~24
   25    38        FETCH_CLASS                                   0  $27     !0
         39        NEW                                              $28     $27
         40        DO_FCALL                                      0          
         41        FREE                                                     $28
   26    42        NOP                                                      
         43        FAST_CONCAT                                      ~30     !0, '+created%0A'
         44        ECHO                                                     ~30
   27    45      > RETURN                                                   null

End of function __construct

End of class Foo\Bar\B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1400 KiB | 15 Q