Edit added.
I get a segmentation error from a triple PHP operation. I am using PHP (5.4.13).
<?php $t = empty($_GET['t2']) ? $_GET['t2'] : 'test'; $t = empty($_GET['t2']) ? 'test' : $_GET['t2']; echo '<pre>'.print_r($t, true).'</pre>'; ?>
Operators:
$t = empty($_GET['t2']) ? $_GET['t2'] : 'test'; $t = empty($_GET['t2']) ? 'test' : $_GET['t2'];
Sends a segmentation error (for this I checked the apache error log). The statements written above do not cause segmentation errors.
I doubt this is the only source error, but this is what I was able to narrow down. Almost all sites using this php now have this problem.
I do not think this is a mistake! More errors when installing php or in one of the dependencies. But since function not used, only language features, I thought that it could be smoothed out quite easily.
EDIT: I wanted to know what common problems cause a segmentation error, and if one of them can be identified from the above code, so that I know where to look for solutions and how to proceed. (this is a question for those who think about it)
EDIT 2: Ready now, no more assignment in $ _GET, so I think now it is advisable and valid. But the error still exists.
EDIT 3: for valgrind trace:
==3775== Process terminating with default action of signal 11 (SIGSEGV) ==3775== Bad permissions for mapped region at address 0x0 ==3775== at 0x0: ??? ==3775== by 0xF60F9F7: execute (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775== by 0xF5A619F: zend_execute_scripts (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775== by 0xF548E87: php_execute_script (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775== by 0xF650A94: ??? (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775== by 0x133BAF: ap_run_handler (in /usr/sbin/httpd) ==3775== by 0x13746D: ap_invoke_handler (in /usr/sbin/httpd) ==3775== by 0x142B2F: ap_process_request (in /usr/sbin/httpd) ==3775== by 0x13F9A7: ??? (in /usr/sbin/httpd) ==3775== by 0x13B6B7: ap_run_process_connection (in /usr/sbin/httpd) ==3775== by 0x147976: ??? (in /usr/sbin/httpd) ==3775== by 0x147C45: ??? (in /usr/sbin/httpd)
and for gdb:
#0 0x0000000000000000 in ?? ()
Final editing
As I suspected from the very beginning, this, of course, was due to a damaged installation of php and its extensions. The code itself did not cause problems, but I assume that it used part of the failed installation. More can be added, but since I did not find the exact reason and its solution, but managed to get it to work again, I thank you all for making the decision.