3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface SlugifierInterface { /** * Return a URL safe version of a string. * * @param string $string * @return string */ public function slugify($string); } class Sluggifier implements SlugifierInterface { public function __construct() { } /* public function slugify($string) { return "I am from" . $string; } */ public function slugify($string) { return "I am from static " . $string; } } echo Sluggifier::slugify("Hello World") . PHP_EOL; $sluggifier = new Sluggifier(); echo $sluggifier->slugify("Hello World from object") . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZX9BV
function name:  (null)
number of ops:  15
compiled vars:  !0 = $sluggifier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'sluggifier'
   30     1        INIT_STATIC_METHOD_CALL                                  'Sluggifier', 'slugify'
          2        SEND_VAL_EX                                              'Hello+World'
          3        DO_FCALL                                      0  $1      
          4        CONCAT                                           ~2      $1, '%0A'
          5        ECHO                                                     ~2
   31     6        NEW                                              $3      'Sluggifier'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $3
   32     9        INIT_METHOD_CALL                                         !0, 'slugify'
         10        SEND_VAL_EX                                              'Hello+World+from+object'
         11        DO_FCALL                                      0  $6      
         12        CONCAT                                           ~7      $6, '%0A'
         13        ECHO                                                     ~7
         14      > RETURN                                                   1

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

End of function slugify

End of class SlugifierInterface.

Class Sluggifier:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZX9BV
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function __construct

Function slugify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZX9BV
function name:  slugify
number of ops:  4
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        CONCAT                                           ~1      'I+am+from+static+', !0
          2      > RETURN                                                   ~1
   28     3*     > RETURN                                                   null

End of function slugify

End of class Sluggifier.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.59 ms | 1395 KiB | 13 Q