3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Plop{ public function getURL($name){ return str_replace('%name%', $name, self::$URL); } } class Test{ use Plop; protected static $URL = '/plop/%name'; } echo Test::getURL('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JjVGj
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'test'
   13     1        INIT_STATIC_METHOD_CALL                                  'Test', 'getURL'
          2        SEND_VAL_EX                                              'test'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Class Plop:
Function geturl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JjVGj
function name:  getURL
number of ops:  9
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%25name%25'
          3        SEND_VAR                                                 !0
          4        FETCH_STATIC_PROP_R          global lock         ~1      'URL'
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
    5     8*     > RETURN                                                   null

End of function geturl

End of class Plop.

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.72 ms | 1395 KiB | 15 Q