Re: Re: [RFC] ifsetor operator
| From: | Red Wingate | Date: | Sat, 17 Apr 2004 02:33:56 +0000 |
| Subject: | Re: Re: [RFC] ifsetor operator | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9310@lists.php.net to get a copy of this message | ||
I guess this would only help the lazy guys around. There are many other
ways to get around this without writing that many ternary constructs
eg:
<?php
function get_post_var ( $name , $default ) {
return isset ( $_POST[ $name ] ) ? $_POST[ $name ] : $default ;} $CUST_ID = (integer) get_post_var ( 'CUST_ID' , 0 ); $EMPL_ID = (integer) get_post_var ( 'EMPL_ID' , 0 ); ... ?> -- red Jason Garber wrote:
Yeah, When we first switched to E_ALL error mode, I thought "Cool, I'll just put an @ in front of these expressions" Not cool. It was taking FOREVER (like seconds) to load a simple page that had been taking ~ 20ms. After that we switched to the ternary operator, and hence began the ifsetor() discussion... ~Jason At 4/17/2004 02:44 AM +0200, Marcus Boerger wrote:Hello Alan, Saturday, April 17, 2004, 2:36:55 AM, you wrote:Jason Garber wrote:so how is that different from $CUST_ID = (integer) @$_POST['CUST_ID'];: 0);In our code, you will find many blocks looking like $CUST_ID = (integer) (isset($_POST['CUST_ID']) ? $_POST['CUST_ID']@ is damn slow -- Best regards,Marcus mailto:helly@php.net-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php