Jump to content

Help with Objects...


troy_mccormick

Recommended Posts

Hello everyone.  I'm not much into OOP or Objects and such, but I'm in a bind attempting to use one.

 

I am attempting to utilize the Texas Hold'em Class (found here) but am having some problems.  Below is my code:

 

<?php
require_once("inc.cls.cardgame.php");
require_once("inc.cls.pokertexasholdem.php");

Card::$tostring = "small_image";

$objDeck = new Deck();
$objDeck->shuffle();

$card_data = array();
$card_data["DECK"] = array();
array_push($card_data["DECK"], $objDeck);

?>

 

The above returns the value as shown below (one card for all 52 obviously...shortened it up for space here):

 

Card Data PRE:

Array
(
[DECK] => Array
	(
		[0] => __PHP_Incomplete_Class Object
			(
				[__PHP_Incomplete_Class_Name] => Deck
				[iNextCard] => 9
				[cards] => Array
					(
						[0] => __PHP_Incomplete_Class Object
							(
								[__PHP_Incomplete_Class_Name] => Card
								[id] => 46
								[name] => eight
								[suit] => spades
								[value] => 8
								[short] => 8
								[pth] => 8
							)
					)
			)
	)
)

 

So what am I missing?!?!

 

Thanks,

 

Troy

Link to comment
https://forums.phpfreaks.com/topic/124861-help-with-objects/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.