3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); trait Macroable { public function __call($name, $args) { } } class Builder { use Macroable { __call as macroCall; } /** * Insert new records into the database. * * @param array $values * @return bool */ public function insert(array $values) { } } $ref = new \ReflectionClass(Builder::class); $method = $ref->getMethod('insert'); var_dump($method->getDeclaringClass()->getTraitAliases());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oSI4m
function name:  (null)
number of ops:  17
compiled vars:  !0 = $ref, !1 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'builder'
   32     1        NEW                                              $2      'ReflectionClass'
          2        SEND_VAL_EX                                              'Builder'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   33     5        INIT_METHOD_CALL                                         !0, 'getMethod'
          6        SEND_VAL_EX                                              'insert'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   34     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !1, 'getDeclaringClass'
         11        DO_FCALL                                      0  $7      
         12        INIT_METHOD_CALL                                         $7, 'getTraitAliases'
         13        DO_FCALL                                      0  $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Macroable:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oSI4m
function name:  __call
number of ops:  3
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2      > RETURN                                                   null

End of function __call

End of class Macroable.

Class Builder:
Function insert:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oSI4m
function name:  insert
number of ops:  2
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   28     1      > RETURN                                                   null

End of function insert

End of class Builder.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.86 ms | 1396 KiB | 15 Q