3v4l.org

run code in 300+ PHP versions simultaneously
<?php function the_title() { echo "Gas & Oil"; } function get_the_title() { return "Gas & Oil"; } ?> <a href="mailto:a@mail.com?subject=<?=urlencode(the_title()); ?>">Apply</a><br> <!-- doesn't work --> <a href="mailto:a@mail.com?subject=<?=urlencode(get_the_title()); ?>">Apply</a> <!-- works -->
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kFu1v
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     '++++%3Ca+href%3D%22mailto%3Aa%40mail.com%3Fsubject%3D'
          1        INIT_FCALL                                               'urlencode'
          2        INIT_FCALL                                               'the_title'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $1      
          6        ECHO                                                     $1
          7        ECHO                                                     '%22%3EApply%3C%2Fa%3E%3Cbr%3E+%3C%21--+doesn%27t+work+--%3E%0A++++%3Ca+href%3D%22mailto%3Aa%40mail.com%3Fsubject%3D'
   10     8        INIT_FCALL                                               'urlencode'
          9        INIT_FCALL                                               'get_the_title'
         10        DO_FCALL                                      0  $2      
         11        SEND_VAR                                                 $2
         12        DO_ICALL                                         $3      
         13        ECHO                                                     $3
         14        ECHO                                                     '%22%3EApply%3C%2Fa%3E+%3C%21--+works+--%3E'
         15      > RETURN                                                   1

Function the_title:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kFu1v
function name:  the_title
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Gas+%26+Oil'
    4     1      > RETURN                                                   null

End of function the_title

Function get_the_title:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kFu1v
function name:  get_the_title
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'Gas+%26+Oil'
    7     1*     > RETURN                                                   null

End of function get_the_title

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.41 ms | 1398 KiB | 17 Q