|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-01-15 17:51 UTC] spam2 at rhsoft dot net
[2018-01-15 17:55 UTC] pyrrahnas at gmail dot com
-Package: Variables related
+Package: *Programming Data Structures
[2018-01-15 17:55 UTC] pyrrahnas at gmail dot com
[2018-01-15 17:56 UTC] peehaa@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: peehaa
[2018-01-15 17:56 UTC] peehaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 17:00:01 2025 UTC |
Description: ------------ On Debian Jessie (9) with PHP 7.0.27-0+deb9u1 (cli), it is impossible to use the character '?' in a function declaration. PHP7.0.27 package is the most recent on Debian 9. I have not found a fix :( Test script: --------------- private function addCityField(FormInterface $form, ?Department $department) { $form->add('city', EntityType::class, [ 'class' => 'AppBundle\Entity\City', 'placeholder' => $department ? 'Select your city' : 'Select your department', 'choices' => $department ? $department->getCities() : [] ]); } Expected result: ---------------- Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) Line with problem : "private function addCityField(FormInterface $form, ?Department $department) {"