3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace NS; class Foo { public static function dirtyStaticFactory() { return new static(1, 2); } private function __construct($arg1, $arg2) { echo "1: $arg1\n2: $arg2\n"; } } var_dump(Foo::dirtyStaticFactory());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0AvfF
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_NS_FCALL_BY_NAME                                    'NS%5Cvar_dump'
          1        INIT_STATIC_METHOD_CALL                                  'NS%5CFoo', 'dirtyStaticFactory'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF_EX                                       $0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class NS\Foo:
Function dirtystaticfactory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0AvfF
function name:  dirtyStaticFactory
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                          static              $0      
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              2
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $0
   10     5*     > RETURN                                                   null

End of function dirtystaticfactory

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0AvfF
function name:  __construct
number of ops:  9
compiled vars:  !0 = $arg1, !1 = $arg2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        ROPE_INIT                                     5  ~3      '1%3A+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '%0A2%3A+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '%0A'
          7        ECHO                                                     ~2
   15     8      > RETURN                                                   null

End of function __construct

End of class NS\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.28 ms | 1395 KiB | 15 Q