3v4l.org

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