3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CLocale { public function test() { return $this->getCanonicalID('foo-bar'); } public static function getCanonicalID($id) { return strtolower(str_replace('-','_',$id)); } } class MyLocale extends CLocale { public static function getCanonicalID($id) { return strtolower(str_replace('-','/',$id)); } } echo (new MyLocale())->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZAIWn
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'MyLocale'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'test'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Class CLocale:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZAIWn
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'getCanonicalID'
          1        SEND_VAL_EX                                              'foo-bar'
          2        DO_FCALL                                      0  $0      
          3      > RETURN                                                   $0
    6     4*     > RETURN                                                   null

End of function test

Function getcanonicalid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZAIWn
function name:  getCanonicalID
number of ops:  11
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'strtolower'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '-'
          4        SEND_VAL                                                 '_'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
   10    10*     > RETURN                                                   null

End of function getcanonicalid

End of class CLocale.

Class MyLocale:
Function getcanonicalid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZAIWn
function name:  getCanonicalID
number of ops:  11
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'strtolower'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '-'
          4        SEND_VAL                                                 '%2F'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
   16    10*     > RETURN                                                   null

End of function getcanonicalid

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZAIWn
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'getCanonicalID'
          1        SEND_VAL_EX                                              'foo-bar'
          2        DO_FCALL                                      0  $0      
          3      > RETURN                                                   $0
    6     4*     > RETURN                                                   null

End of function test

End of class MyLocale.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.6 ms | 1451 KiB | 15 Q