3v4l.org

run code in 300+ PHP versions simultaneously
<?php //this code will append a &mobileapp to every https://example.com url and http://foobar.com url ob_start(function($buffer){ $append = 'mobileapp'; $doc = new DOMDocument(); $doc->loadHTML($buffer); $xpath = new DOMXpath($doc); $elements = $xpath->query('//*[@href OR @src OR @action]'); if (is_null($elements)) { //nothing to replace return $buffer; } foreach ($elements as $element) { } return $buffer; }); ?> <html> <head> </head> <body> http://foobar.com http://www.example.com/~hillybilly/foobar.php silly silly </body> </html> <?php ob_end_flush();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PueTY
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ob_start'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPueTY%3A3%240'
   21     2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   23     4        ECHO                                                     '%3Chtml%3E%0A++++%3Chead%3E%0A++++%3C%2Fhead%3E%0A++++%3Cbody%3E%0Ahttp%3A%2F%2Ffoobar.com%0Ahttp%3A%2F%2Fwww.example.com%2F%7Ehillybilly%2Ffoobar.php%0Asilly+silly%0A++++%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A'
   33     5        INIT_FCALL                                               'ob_end_flush'
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPueTY%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/PueTY
function name:  {closure}
number of ops:  25
compiled vars:  !0 = $buffer, !1 = $append, !2 = $doc, !3 = $xpath, !4 = $elements, !5 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 'mobileapp'
    5     2        NEW                                              $7      'DOMDocument'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $7
    6     5        INIT_METHOD_CALL                                         !2, 'loadHTML'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
    7     8        NEW                                              $11     'DOMXpath'
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $11
   11    12        INIT_METHOD_CALL                                         !3, 'query'
         13        SEND_VAL_EX                                              '%2F%2F%2A%5B%40href+OR+%40src+OR+%40action%5D'
         14        DO_FCALL                                      0  $14     
         15        ASSIGN                                                   !4, $14
   12    16        TYPE_CHECK                                    2          !4
         17      > JMPZ                                                     ~16, ->19
   14    18    > > RETURN                                                   !0
   17    19    > > FE_RESET_R                                       $17     !4, ->22
         20    > > FE_FETCH_R                                               $17, !5, ->22
         21    > > JMP                                                      ->20
         22    >   FE_FREE                                                  $17
   20    23      > RETURN                                                   !0
   21    24*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPueTY%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.23 ms | 1400 KiB | 17 Q