3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* User Defined Functions function function_name($arg_1, $arg_2, ..., $arg_n) { code_line1; code_line2; code_line3; return ($value); //stops execution of the function and returns its argument as the value at the point where the function was called. } One may have more than one return()statements in a function. */ $text= 'This Line is Bold and Italics.'; function makebold_n_italics($text) { $text = "<i><b>$text</i></b>"; return($text); //the return() statement immediately ends execution of the current function, and returns its argument as the value of the function call in print command } print("This Line is not Bold.<br>\n"); print("This Line is not Italics.<br>\n"); echo makebold_n_italics("$text") ,"--->", 'It prints the returned value of variable $text when function is called.'."<br>\n"; echo "$text", '---> prints the original value of variable $text.'."<br>\n"; // prints the original value of $text $thanks='Thanks to Zeev Suraski and Andi Gutmans !!!'; $text=$thanks; echo makebold_n_italics("$text");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UJT9D
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $thanks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 'This+Line+is+Bold+and+Italics.'
   21     1        ECHO                                                     'This+Line+is+not+Bold.%3Cbr%3E%0A'
   22     2        ECHO                                                     'This+Line+is+not+Italics.%3Cbr%3E%0A'
   23     3        INIT_FCALL                                               'makebold_n_italics'
          4        CAST                                          6  ~3      !0
          5        SEND_VAL                                                 ~3
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8        ECHO                                                     '---%3E'
          9        ECHO                                                     'It+prints+the+returned+value+of+variable+%24text+when+function+is+called.%3Cbr%3E%0A'
   24    10        CAST                                          6  ~5      !0
         11        ECHO                                                     ~5
         12        ECHO                                                     '---%3E+prints+the+original+value+of++variable+%24text.%3Cbr%3E%0A'
   25    13        ASSIGN                                                   !1, 'Thanks+to+Zeev+Suraski+and+Andi+Gutmans+%21%21%21'
   26    14        ASSIGN                                                   !0, !1
   27    15        INIT_FCALL                                               'makebold_n_italics'
         16        CAST                                          6  ~8      !0
         17        SEND_VAL                                                 ~8
         18        DO_FCALL                                      0  $9      
         19        ECHO                                                     $9
         20      > RETURN                                                   1

Function makebold_n_italics:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UJT9D
function name:  makebold_n_italics
number of ops:  7
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        ROPE_INIT                                     3  ~2      '%3Ci%3E%3Cb%3E'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%3C%2Fi%3E%3C%2Fb%3E'
          4        ASSIGN                                                   !0, ~1
   19     5      > RETURN                                                   !0
   20     6*     > RETURN                                                   null

End of function makebold_n_italics

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.94 ms | 1399 KiB | 15 Q