3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Abstract Surfer Class * * @package hangten */ abstract class Surfer { abstract public function rideWave($amplitude); 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!"); } } if(strnatcmp(phpversion(),'5.3.0') < 0){ echo("Error : must have PHP version 5.3+ to run this script."); die(); } // 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 = 10
Branch analysis from position: 8
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p2BcL
function name:  (null)
number of ops:  37
compiled vars:  !0 = $rookie, !1 = $pro
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   60     0  E >   INIT_FCALL                                               'strnatcmp'
          1        INIT_FCALL                                               'phpversion'
          2        DO_ICALL                                         $2      
          3        SEND_VAR                                                 $2
          4        SEND_VAL                                                 '5.3.0'
          5        DO_ICALL                                         $3      
          6        IS_SMALLER                                               $3, 0
          7      > JMPZ                                                     ~4, ->10
   61     8    >   ECHO                                                     'Error+%3A+must+have+PHP+version+5.3%2B+to+run+this+script.'
   62     9      > EXIT                                                     
   66    10    >   NEW                                              $5      'RookieSurfer'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !0, $5
   67    13        INIT_METHOD_CALL                                         !0, 'applyWax'
         14        SEND_VAL_EX                                              'Candle+Wax'
         15        DO_FCALL                                      0          
   68    16        INIT_METHOD_CALL                                         !0, 'paddleOut'
         17        DO_FCALL                                      0          
   69    18        INIT_METHOD_CALL                                         !0, 'rideWave'
         19        SEND_VAL_EX                                              2
         20        DO_FCALL                                      0          
   70    21        INIT_METHOD_CALL                                         !0, 'screamShark'
         22        DO_FCALL                                      0          
   73    23        NEW                                              $12     'ProSurfer'
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !1, $12
   74    26        INIT_METHOD_CALL                                         !1, 'applyWax'
         27        SEND_VAL_EX                                              'Sex+Wax'
         28        DO_FCALL                                      0          
   75    29        INIT_METHOD_CALL                                         !1, 'paddleOut'
         30        DO_FCALL                                      0          
   76    31        INIT_METHOD_CALL                                         !1, 'rideWave'
         32        SEND_VAL_EX                                              50
         33        DO_FCALL                                      0          
   77    34        INIT_METHOD_CALL                                         !1, 'killSharkWithBoard'
         35        DO_FCALL                                      0          
         36      > RETURN                                                   1

Class Surfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p2BcL
function name:  rideWave
number of ops:  2
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !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/p2BcL
function name:  applyWax
number of ops:  7
compiled vars:  !0 = $waxType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     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          
   14     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/p2BcL
function name:  paddleOut
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Paddling+Out....'
          2        DO_FCALL                                      0          
   18     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/p2BcL
function name:  screamShark
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'SHARK%21%21'
          2        DO_FCALL                                      0          
   22     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/p2BcL
function name:  printMessage
number of ops:  11
compiled vars:  !0 = $msg, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV_INIT                                        !0      ''
   25     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
   26     8        CONCAT                                           ~6      !0, !1
          9        ECHO                                                     ~6
   27    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/p2BcL
function name:  rideWave
number of ops:  7
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV_INIT                                        !0      1
   39     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          
   40     6      > 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/p2BcL
function name:  applyWax
number of ops:  7
compiled vars:  !0 = $waxType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     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          
   14     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/p2BcL
function name:  paddleOut
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Paddling+Out....'
          2        DO_FCALL                                      0          
   18     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/p2BcL
function name:  screamShark
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'SHARK%21%21'
          2        DO_FCALL                                      0          
   22     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/p2BcL
function name:  printMessage
number of ops:  11
compiled vars:  !0 = $msg, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV_INIT                                        !0      ''
   25     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
   26     8        CONCAT                                           ~6      !0, !1
          9        ECHO                                                     ~6
   27    10      > RETURN                                                   null

End of function printmessage

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/p2BcL
function name:  rideWave
number of ops:  7
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV_INIT                                        !0      8
   52     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          
   53     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/p2BcL
function name:  killSharkWithBoard
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     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          
   57     3      > RETURN                                                   null

End of function killsharkwithboard

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p2BcL
function name:  applyWax
number of ops:  7
compiled vars:  !0 = $waxType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     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          
   14     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/p2BcL
function name:  paddleOut
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Paddling+Out....'
          2        DO_FCALL                                      0          
   18     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/p2BcL
function name:  screamShark
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'SHARK%21%21'
          2        DO_FCALL                                      0          
   22     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/p2BcL
function name:  printMessage
number of ops:  11
compiled vars:  !0 = $msg, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV_INIT                                        !0      ''
   25     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
   26     8        CONCAT                                           ~6      !0, !1
          9        ECHO                                                     ~6
   27    10      > RETURN                                                   null

End of function printmessage

End of class ProSurfer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.08 ms | 1404 KiB | 17 Q