3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(strnatcmp(phpversion(),'5.0.0') < 0){ echo("Error : must have PHP version 5+ to run this script."); die(); } else { /** * Abstract Surfer Class * * @package hangten */ abstract class Surfer { abstract public function rideWave($amplitude = 0); public function applyWax($waxType){ $this->printMessage("Ahh, all waxed up with '".$waxType."', ready to go!"); } public function paddleOut(){ $this->printMessage("Paddling Out...."); } public function screamShark(){ $this->printMessage("SHARK!!"); } public function printMessage($msg = ""){ $lt = (isset($_SERVER['HTTP_USER_AGENT']))?"<br />":"\r\n"; print($msg.$lt); } } /** * RookieSurfer Class * * This surfer is green and can barely surf =) * @package hangten */ class RookieSurfer extends Surfer { public function rideWave($amplitude = 1){ $this->printMessage("Trying.. Trying.. to ride a ".$amplitude."ft. wave, whew!"); } } /** * ProSurfer Class * * This surfer is crazy skilled!! * @package hangten */ class ProSurfer extends Surfer { public function rideWave($amplitude = 8){ $this->printMessage("Riding a ".$amplitude."ft. wave backwards doing a backflip!"); } public function killSharkWithBoard(){ $this->printMessage("Totally just sliced that shark in two, he's over it!! booya!"); } } // Rookie Instantiation $rookie = new RookieSurfer; $rookie->applyWax("Candle Wax"); $rookie->paddleOut(); $rookie->rideWave(2); $rookie->screamShark(); // Pro Instantiation $pro = new ProSurfer; $pro->applyWax("Sex Wax"); $pro->paddleOut(); $pro->rideWave(50); $pro->killSharkWithBoard(); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  (null)
number of ops:  41
compiled vars:  !0 = $rookie, !1 = $pro
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'strnatcmp'
          1        INIT_FCALL                                               'phpversion'
          2        DO_ICALL                                         $2      
          3        SEND_VAR                                                 $2
          4        SEND_VAL                                                 '5.0.0'
          5        DO_ICALL                                         $3      
          6        IS_SMALLER                                               $3, 0
          7      > JMPZ                                                     ~4, ->11
    4     8    >   ECHO                                                     'Error+%3A+must+have+PHP+version+5%2B+to+run+this+script.'
    5     9      > EXIT                                                     
         10*       JMP                                                      ->40
   13    11    >   DECLARE_CLASS                                            'surfer'
   41    12        DECLARE_CLASS                                            'rookiesurfer', 'surfer'
   54    13        DECLARE_CLASS                                            'prosurfer', 'surfer'
   66    14        NEW                                              $5      'RookieSurfer'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !0, $5
   67    17        INIT_METHOD_CALL                                         !0, 'applyWax'
         18        SEND_VAL_EX                                              'Candle+Wax'
         19        DO_FCALL                                      0          
   68    20        INIT_METHOD_CALL                                         !0, 'paddleOut'
         21        DO_FCALL                                      0          
   69    22        INIT_METHOD_CALL                                         !0, 'rideWave'
         23        SEND_VAL_EX                                              2
         24        DO_FCALL                                      0          
   70    25        INIT_METHOD_CALL                                         !0, 'screamShark'
         26        DO_FCALL                                      0          
   73    27        NEW                                              $12     'ProSurfer'
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !1, $12
   74    30        INIT_METHOD_CALL                                         !1, 'applyWax'
         31        SEND_VAL_EX                                              'Sex+Wax'
         32        DO_FCALL                                      0          
   75    33        INIT_METHOD_CALL                                         !1, 'paddleOut'
         34        DO_FCALL                                      0          
   76    35        INIT_METHOD_CALL                                         !1, 'rideWave'
         36        SEND_VAL_EX                                              50
         37        DO_FCALL                                      0          
   77    38        INIT_METHOD_CALL                                         !1, 'killSharkWithBoard'
         39        DO_FCALL                                      0          
   79    40      > RETURN                                                   1

Class Surfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  rideWave
number of ops:  2
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_INIT                                        !0      0
          1      > RETURN                                                   null

End of function ridewave

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  applyWax
number of ops:  7
compiled vars:  !0 = $waxType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Ahh%2C+all+waxed+up+with+%27', !0
          3        CONCAT                                           ~2      ~1, '%27%2C+ready+to+go%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   19     6      > RETURN                                                   null

End of function applywax

Function paddleout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  paddleOut
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Paddling+Out....'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function paddleout

Function screamshark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  screamShark
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'SHARK%21%21'
          2        DO_FCALL                                      0          
   27     3      > RETURN                                                   null

End of function screamshark

Function printmessage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  printMessage
number of ops:  11
compiled vars:  !0 = $msg, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV_INIT                                        !0      ''
   30     1        FETCH_IS                                         ~2      '_SERVER'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, 'HTTP_USER_AGENT'
          3      > JMPZ                                                     ~3, ->6
          4    >   QM_ASSIGN                                        ~4      '%3Cbr+%2F%3E'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      '%0D%0A'
          7    >   ASSIGN                                                   !1, ~4
   31     8        CONCAT                                           ~6      !0, !1
          9        ECHO                                                     ~6
   32    10      > RETURN                                                   null

End of function printmessage

End of class Surfer.

Class RookieSurfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  rideWave
number of ops:  7
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   RECV_INIT                                        !0      1
   44     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Trying..+Trying..+to+ride+a+', !0
          3        CONCAT                                           ~2      ~1, 'ft.+wave%2C+whew%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   45     6      > RETURN                                                   null

End of function ridewave

End of class RookieSurfer.

Class ProSurfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  rideWave
number of ops:  7
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV_INIT                                        !0      8
   57     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Riding+a+', !0
          3        CONCAT                                           ~2      ~1, 'ft.+wave+backwards+doing+a+backflip%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   58     6      > RETURN                                                   null

End of function ridewave

Function killsharkwithboard:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHJVn
function name:  killSharkWithBoard
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Totally+just+sliced+that+shark+in+two%2C+he%27s+over+it%21%21+booya%21'
          2        DO_FCALL                                      0          
   62     3      > RETURN                                                   null

End of function killsharkwithboard

End of class ProSurfer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.92 ms | 1404 KiB | 17 Q