Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-03-2006, 07:30 PM   #1 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 150
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
Paypal SDK

I'm looking into using Website Payments Pro through paypal for transactions, but I'm having a little difficulty understanding everything. There's always been this stigma in regard to accepting online transactions for me. Anyway, I'm looking through example code and came across the following:
PHP Code:
<?php

require_once './request_base.php';

$avrt =& Services_PayPal::getType('AddressVerifyRequestType');
$avrt->setEmail('sdk-buyer@sdk.com');
$avrt->setZip('95100');
$avrt->setStreet('123 Main St');

$response $caller->AddressVerify($avrt);
var_dump($response);
?>
I've never seen the =& operator, what is that line doing? From the looks of it, that line is initiating a new instance of the Services_PayPal object? Obviously the following lines set the address of the buyer, and send it off for verification?
__________________
Current Project
Redline is offline   Reply With Quote
Old 05-04-2006, 04:35 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 672
DJMaze is on a distinguished road
'=&' makes a reference (in C known as pointer) to a data object in memory.
This way you don't duplicate the memory but share the same memory to prevent resource increase.

In case of a Object like
PHP Code:
<?php
$ref 
=& new Object();
you are working on the base object and NOT a instance.
So if you create an object like this and create another instance, you actualy get all the values of $ref.
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
downloading the java sdk without the sun application server? sde Java 2 08-02-2004 07:53 AM
Java 2 SDK Rotkiv Java 8 05-02-2004 11:39 PM
Platform SDK vs. MFC DarkTwilkitri Standard C, C++ 3 03-15-2004 02:31 PM


All times are GMT -8. The time now is 09:19 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting