3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php register_tick_function(function () { echo "Tick", PHP_EOL; throw new \Exception("Software interrupt"); }); /*declare(ticks=1) */{ try { $loopIndex = 0; while ($loopIndex < 1e3) { $loopIndex++; echo "Index {$loopIndex}", PHP_EOL; } } catch (\Exception $e) { echo "Received termination signal"; } }
Output for 5.3.0 - 5.6.21, 7.0.0 - 7.1.0
Index 1 Index 2 Index 3 Index 4 Index 5 Index 6 Index 7 Index 8 Index 9 Index 10 Index 11 Index 12 Index 13 Index 14 Index 15 Index 16 Index 17 Index 18 Index 19 Index 20 Index 21 Index 22 Index 23 Index 24 Index 25 Index 26 Index 27 Index 28 Index 29 Index 30 Index 31 Index 32 Index 33 Index 34 Index 35 Index 36 Index 37 Index 38 Index 39 Index 40 Index 41 Index 42 Index 43 Index 44 Index 45 Index 46 Index 47 Index 48 Index 49 Index 50 Index 51 Index 52 Index 53 Index 54 Index 55 Index 56 Index 57 Index 58 Index 59 Index 60 Index 61 Index 62 Index 63 Index 64 Index 65 Index 66 Index 67 Index 68 Index 69 Index 70 Index 71 Index 72 Index 73 Index 74 Index 75 Index 76 Index 77 Index 78 Index 79 Index 80 Index 81 Index 82 Index 83 Index 84 Index 85 Index 86 Index 87 Index 88 Index 89 Index 90 Index 91 Index 92 Index 93 Index 94 Index 95 Index 96 Index 97 Index 98 Index 99 Index 100 Index 101 Index 102 Index 103 Index 104 Index 105 Index 106 Index 107 Index 108 Index 109 Index 110 Index 111 Index 112 Index 113 Index 114 Index 115 Index 116 Index 117 Index 118 Index 119 Index 120 Index 121 Index 122 Index 123 Index 124 Index 125 Index 126 Index 127 Index 128 Index 129 Index 130 Index 131 Index 132 Index 133 Index 134 Index 135 Index 136 Index 137 Index 138 Index 139 Index 140 Index 141 Index 142 Index 143 Index 144 Index 145 Index 146 Index 147 Index 148 Index 149 Index 150 Index 151 Index 152 Index 153 Index 154 Index 155 Index 156 Index 157 Index 158 Index 159 Index 160 Index 161 Index 162 Index 163 Index 164 Index 165 Index 166 Index 167 Index 168 Index 169 Index 170 Index 171 Index 172 Index 173 Index 174 Index 175 Index 176 Index 177 Index 178 Index 179 Index 180 Index 181 Index 182 Index 183 Index 184 Index 185 Index 186 Index 187 Index 188 Index 189 Index 190 Index 191 Index 192 Index 193 Index 194 Index 195 Index 196 Index 197 Index 198 Index 199 Index 200 Index 201 Index 202 Index 203 Index 204 Index 205 Index 206 Index 207 Index 208 Index 209 Index 210 Index 211 Index 212 Index 213 Index 214 Index 215 Index 216 Index 217 Index 218 Index 219 Index 220 Index 221 Index 222 Index 223 Index 224 Index 225 Index 226 Index 227 Index 228 Index 229 Index 230 Index 231 Index 232 Index 233 Index 234 Index 235 Index 236 Index 237 Index 238 Index 239 Index 240 Index 241 Index 242 Index 243 Index 244 Index 245 Index 246 Index 247 Index 248 Index 249 Index 250 Index 251 Index 252 Index 253 Index 254 Index 255 Index 256 Index 257 Index 258 Index 259 Index 260 Index 261 Index 262 Index 263 Index 264 Index 265 Index 266 Index 267 Index 268 Index 269 Index 270 Index 271 Index 272 Index 273 Index 274 Index 275 Index 276 Index 277 Index 278 Index 279 Index 280 Index 281 Index 282 Index 283 Index 284 Index 285 Index 286 Index 287 Index 288 Index 289 Index 290 Index 291 Index 292 Index 293 Index 294 Index 295 Index 296 Index 297 Index 298 Index 299 Index 300 Index 301 Index 302 Index 303 Index 304 Index 305 Index 306 Index 307 Index 308 Index 309 Index 310 Index 311 Index 312 Index 313 Index 314 Index 315 Index 316 Index 317 Index 318 Index 319 Index 320 Index 321 Index 322 Index 323 Index 324 Index 325 Index 326 Index 327 Index 328 Index 329 Index 330 Index 331 Index 332 Index 333 Index 334 Index 335 Index 336 Index 337 Index 338 Index 339 Index 340 Index 341 Index 342 Index 343 Index 344 Index 345 Index 346 Index 347 Index 348 Index 349 Index 350 Index 351 Index 352 Index 353 Index 354 Index 355 Index 356 Index 357 Index 358 Index 359 Index 360 Index 361 Index 362 Index 363 Index 364 Index 365 Index 366 Index 367 Index 368 Index 369 Index 370 Index 371 Index 372 Index 373 Index 374 Index 375 Index 376 Index 377 Index 378 Index 379 Index 380 Index 381 Index 382 Index 383 Index 384 Index 385 Index 386 Index 387 Index 388 Index 389 Index 390 Index 391 Index 392 Index 393 Index 394 Index 395 Index 396 Index 397 Index 398 Index 399 Index 400 Index 401 Index 402 Index 403 Index 404 Index 405 Index 406 Index 407 Index 408 Index 409 Index 410 Index 411 Index 412 Index 413 Index 414 Index 415 Index 416 Index 417 Index 418 Index 419 Index 420 Index 421 Index 422 Index 423 Index 424 Index 425 Index 426 Index 427 Index 428 Index 429 Index 430 Index 431 Index 432 Index 433 Index 434 Index 435 Index 436 Index 437 Index 438 Index 439 Index 440 Index 441 Index 442 Index 443 Index 444 Index 445 Index 446 Index 447 Index 448 Index 449 Index 450 Index 451 Index 452 Index 453 Index 454 Index 455 Index 456 Index 457 Index 458 Index 459 Index 460 Index 461 Index 462 Index 463 Index 464 Index 465 Index 466 Index 467 Index 468 Index 469 Index 470 Index 471 Index 472 Index 473 Index 474 Index 475 Index 476 Index 477 Index 478 Index 479 Index 480 Index 481 Index 482 Index 483 Index 484 Index 485 Index 486 Index 487 Index 488 Index 489 Index 490 Index 491 Index 492 Index 493 Index 494 Index 495 Index 496 Index 497 Index 498 Index 499 Index 500 Index 501 Index 502 Index 503 Index 504 Index 505 Index 506 Index 507 Index 508 Index 509 Index 510 Index 511 Index 512 Index 513 Index 514 Index 515 Index 516 Index 517 Index 518 Index 519 Index 520 Index 521 Index 522 Index 523 Index 524 Index 525 Index 526 Index 527 Index 528 Index 529 Index 530 Index 531 Index 532 Index 533 Index 534 Index 535 Index 536 Index 537 Index 538 Index 539 Index 540 Index 541 Index 542 Index 543 Index 544 Index 545 Index 546 Index 547 Index 548 Index 549 Index 550 Index 551 Index 552 Index 553 Index 554 Index 555 Index 556 Index 557 Index 558 Index 559 Index 560 Index 561 Index 562 Index 563 Index 564 Index 565 Index 566 Index 567 Index 568 Index 569 Index 570 Index 571 Index 572 Index 573 Index 574 Index 575 Index 576 Index 577 Index 578 Index 579 Index 580 Index 581 Index 582 Index 583 Index 584 Index 585 Index 586 Index 587 Index 588 Index 589 Index 590 Index 591 Index 592 Index 593 Index 594 Index 595 Index 596 Index 597 Index 598 Index 599 Index 600 Index 601 Index 602 Index 603 Index 604 Index 605 Index 606 Index 607 Index 608 Index 609 Index 610 Index 611 Index 612 Index 613 Index 614 Index 615 Index 616 Index 617 Index 618 Index 619 Index 620 Index 621 Index 622 Index 623 Index 624 Index 625 Index 626 Index 627 Index 628 Index 629 Index 630 Index 631 Index 632 Index 633 Index 634 Index 635 Index 636 Index 637 Index 638 Index 639 Index 640 Index 641 Index 642 Index 643 Index 644 Index 645 Index 646 Index 647 Index 648 Index 649 Index 650 Index 651 Index 652 Index 653 Index 654 Index 655 Index 656 Index 657 Index 658 Index 659 Index 660 Index 661 Index 662 Index 663 Index 664 Index 665 Index 666 Index 667 Index 668 Index 669 Index 670 Index 671 Index 672 Index 673 Index 674 Index 675 Index 676 Index 677 Index 678 Index 679 Index 680 Index 681 Index 682 Index 683 Index 684 Index 685 Index 686 Index 687 Index 688 Index 689 Index 690 Index 691 Index 692 Index 693 Index 694 Index 695 Index 696 Index 697 Index 698 Index 699 Index 700 Index 701 Index 702 Index 703 Index 704 Index 705 Index 706 Index 707 Index 708 Index 709 Index 710 Index 711 Index 712 Index 713 Index 714 Index 715 Index 716 Index 717 Index 718 Index 719 Index 720 Index 721 Index 722 Index 723 Index 724 Index 725 Index 726 Index 727 Index 728 Index 729 Index 730 Index 731 Index 732 Index 733 Index 734 Index 735 Index 736 Index 737 Index 738 Index 739 Index 740 Index 741 Index 742 Index 743 Index 744 Index 745 Index 746 Index 747 Index 748 Index 749 Index 750 Index 751 Index 752 Index 753 Index 754 Index 755 Index 756 Index 757 Index 758 Index 759 Index 760 Index 761 Index 762 Index 763 Index 764 Index 765 Index 766 Index 767 Index 768 Index 769 Index 770 Index 771 Index 772 Index 773 Index 774 Index 775 Index 776 Index 777 Index 778 Index 779 Index 780 Index 781 Index 782 Index 783 Index 784 Index 785 Index 786 Index 787 Index 788 Index 789 Index 790 Index 791 Index 792 Index 793 Index 794 Index 795 Index 796 Index 797 Index 798 Index 799 Index 800 Index 801 Index 802 Index 803 Index 804 Index 805 Index 806 Index 807 Index 808 Index 809 Index 810 Index 811 Index 812 Index 813 Index 814 Index 815 Index 816 Index 817 Index 818 Index 819 Index 820 Index 821 Index 822 Index 823 Index 824 Index 825 Index 826 Index 827 Index 828 Index 829 Index 830 Index 831 Index 832 Index 833 Index 834 Index 835 Index 836 Index 837 Index 838 Index 839 Index 840 Index 841 Index 842 Index 843 Index 844 Index 845 Index 846 Index 847 Index 848 Index 849 Index 850 Index 851 Index 852 Index 853 Index 854 Index 855 Index 856 Index 857 Index 858 Index 859 Index 860 Index 861 Index 862 Index 863 Index 864 Index 865 Index 866 Index 867 Index 868 Index 869 Index 870 Index 871 Index 872 Index 873 Index 874 Index 875 Index 876 Index 877 Index 878 Index 879 Index 880 Index 881 Index 882 Index 883 Index 884 Index 885 Index 886 Index 887 Index 888 Index 889 Index 890 Index 891 Index 892 Index 893 Index 894 Index 895 Index 896 Index 897 Index 898 Index 899 Index 900 Index 901 Index 902 Index 903 Index 904 Index 905 Index 906 Index 907 Index 908 Index 909 Index 910 Index 911 Index 912 Index 913 Index 914 Index 915 Index 916 Index 917 Index 918 Index 919 Index 920 Index 921 Index 922 Index 923 Index 924 Index 925 Index 926 Index 927 Index 928 Index 929 Index 930 Index 931 Index 932 Index 933 Index 934 Index 935 Index 936 Index 937 Index 938 Index 939 Index 940 Index 941 Index 942 Index 943 Index 944 Index 945 Index 946 Index 947 Index 948 Index 949 Index 950 Index 951 Index 952 Index 953 Index 954 Index 955 Index 956 Index 957 Index 958 Index 959 Index 960 Index 961 Index 962 Index 963 Index 964 Index 965 Index 966 Index 967 Index 968 Index 969 Index 970 Index 971 Index 972 Index 973 Index 974 Index 975 Index 976 Index 977 Index 978 Index 979 Index 980 Index 981 Index 982 Index 983 Index 984 Index 985 Index 986 Index 987 Index 988 Index 989 Index 990 Index 991 Index 992 Index 993 Index 994 Index 995 Index 996 Index 997 Index 998 Index 999 Index 1000
Output for hhvm-3.12.0
Fatal error: Call to undefined function register_tick_function() in /in/8tUIA on line 6
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/8tUIA on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/8tUIA on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/8tUIA on line 3
Process exited with code 255.