3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); class HelloWorld { use Help; public function sayHello(DateTimeImutable $date): void { $this->attachTag(); } } trait Help { public function attachTag( string $type = self::class ): void { var_dump($type); } } $hw = new HelloWorld(); $hw->attachTag();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P7Bmd
function name:  (null)
number of ops:  7
compiled vars:  !0 = $hw
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'helloworld'
   22     1        NEW                                                  $1      'HelloWorld'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   23     4        INIT_METHOD_CALL                                             !0, 'attachTag'
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

Class HelloWorld:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P7Bmd
function name:  sayHello
number of ops:  4
compiled vars:  !0 = $date
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        INIT_METHOD_CALL                                             'attachTag'
          2        DO_FCALL                                          0          
   10     3      > RETURN                                                       null

End of function sayhello

End of class HelloWorld.

Class Help:
Function attachtag:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P7Bmd
function name:  attachTag
number of ops:  5
compiled vars:  !0 = $type
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV_INIT                                            !0      <const ast>
   18     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                                     
   19     4      > RETURN                                                       null

End of function attachtag

End of class Help.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.78 ms | 2100 KiB | 14 Q