3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $num = 50; for($i = 1; $i <= 365; $i++) { static $total; $num = $num + 2; $total = $num + $total; echo $num . "<br>"; } echo 'total = ' . $total;
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
52<br>54<br>56<br>58<br>60<br>62<br>64<br>66<br>68<br>70<br>72<br>74<br>76<br>78<br>80<br>82<br>84<br>86<br>88<br>90<br>92<br>94<br>96<br>98<br>100<br>102<br>104<br>106<br>108<br>110<br>112<br>114<br>116<br>118<br>120<br>122<br>124<br>126<br>128<br>130<br>132<br>134<br>136<br>138<br>140<br>142<br>144<br>146<br>148<br>150<br>152<br>154<br>156<br>158<br>160<br>162<br>164<br>166<br>168<br>170<br>172<br>174<br>176<br>178<br>180<br>182<br>184<br>186<br>188<br>190<br>192<br>194<br>196<br>198<br>200<br>202<br>204<br>206<br>208<br>210<br>212<br>214<br>216<br>218<br>220<br>222<br>224<br>226<br>228<br>230<br>232<br>234<br>236<br>238<br>240<br>242<br>244<br>246<br>248<br>250<br>252<br>254<br>256<br>258<br>260<br>262<br>264<br>266<br>268<br>270<br>272<br>274<br>276<br>278<br>280<br>282<br>284<br>286<br>288<br>290<br>292<br>294<br>296<br>298<br>300<br>302<br>304<br>306<br>308<br>310<br>312<br>314<br>316<br>318<br>320<br>322<br>324<br>326<br>328<br>330<br>332<br>334<br>336<br>338<br>340<br>342<br>344<br>346<br>348<br>350<br>352<br>354<br>356<br>358<br>360<br>362<br>364<br>366<br>368<br>370<br>372<br>374<br>376<br>378<br>380<br>382<br>384<br>386<br>388<br>390<br>392<br>394<br>396<br>398<br>400<br>402<br>404<br>406<br>408<br>410<br>412<br>414<br>416<br>418<br>420<br>422<br>424<br>426<br>428<br>430<br>432<br>434<br>436<br>438<br>440<br>442<br>444<br>446<br>448<br>450<br>452<br>454<br>456<br>458<br>460<br>462<br>464<br>466<br>468<br>470<br>472<br>474<br>476<br>478<br>480<br>482<br>484<br>486<br>488<br>490<br>492<br>494<br>496<br>498<br>500<br>502<br>504<br>506<br>508<br>510<br>512<br>514<br>516<br>518<br>520<br>522<br>524<br>526<br>528<br>530<br>532<br>534<br>536<br>538<br>540<br>542<br>544<br>546<br>548<br>550<br>552<br>554<br>556<br>558<br>560<br>562<br>564<br>566<br>568<br>570<br>572<br>574<br>576<br>578<br>580<br>582<br>584<br>586<br>588<br>590<br>592<br>594<br>596<br>598<br>600<br>602<br>604<br>606<br>608<br>610<br>612<br>614<br>616<br>618<br>620<br>622<br>624<br>626<br>628<br>630<br>632<br>634<br>636<br>638<br>640<br>642<br>644<br>646<br>648<br>650<br>652<br>654<br>656<br>658<br>660<br>662<br>664<br>666<br>668<br>670<br>672<br>674<br>676<br>678<br>680<br>682<br>684<br>686<br>688<br>690<br>692<br>694<br>696<br>698<br>700<br>702<br>704<br>706<br>708<br>710<br>712<br>714<br>716<br>718<br>720<br>722<br>724<br>726<br>728<br>730<br>732<br>734<br>736<br>738<br>740<br>742<br>744<br>746<br>748<br>750<br>752<br>754<br>756<br>758<br>760<br>762<br>764<br>766<br>768<br>770<br>772<br>774<br>776<br>778<br>780<br>total = 151840
Output for hhvm-3.10.0

Process exited with code 153.