3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function actionUpdate($id) { $didLoad = false; $model = $this->findModel($id); // var_dump($model->title); $didLoad = true; if ($model->load(Yii::$app->request->post()) && $model->save()) { var_dump($didLoad); return $this->redirect(['index', 'id' => $model->id]); } return $this->render('update', [ 'model' => $model, ]); }
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Parse error: syntax error, unexpected token "public", expecting end of file in /in/E3DaS on line 4
Process exited with code 255.

preferences:
174.9 ms | 1008 KiB | 7 Q