Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 592721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:46:10+00:00 2026-05-13T15:46:10+00:00

I have some PHP code, listed below. I have a trap that tells me

  • 0

I have some PHP code, listed below. I have a trap that tells me if the data input does not match any of the tests in the code (“There is no spoon”, it says. Clever, eh?).

The trouble comes when data – that isn’t unusual in any way that I can see, and for that matter, is completely similar to other data that survives this trap – that does match one of the tests somehow makes it through anyway. And of course, the “unexpected error” error outputs the data that was input, just to make sure. As far as I can tell, that input data has nothing wrong with it.

First, there’s the output, which might make things a little easier to understand:

Customer XXXXXXXXXXXX, DID XXXXX2515  has been billed already for 2010-01.
Deleting last billing from database before continuing.
This DID is a Toll Free Number.
Trunkrate is therefore: 0.05
Starting billing for DID XXXXXX2515
Trunkrate: 0.05 Type: TFN

2010-01-22 15:45:15: billsecs: 22 billMin: 1 Source: XXXXXX0808 Destination: XXXXXX2515
Error 34: There is no spoon.
Source: XXXXXX0808 Destination: XXXXXX2515 Did: XXXXXX2515  Type: TFN

2010-01-12 14:49:41: billsecs: 55 billMin: 1 Source: 0000000000 Destination: XXXXXX2515
Error 34: There is no spoon.
Source: 0000000000 Destination: XXXXXX2515 Did: XXXXXX2515  Type: TFN

2010-01-12 11:46:45: billsecs: 6 billMin: 1 Source: XXXXXX8689 Destination: XXXXXX2515
Error 34: There is no spoon.
Source: XXXXXX8689 Destination: XXXXXX2515 Did: XXXXXX2515  Type: TFN

2010-01-08 12:56:57: billsecs: 610 billMin: 11 Source: XXXXXX2515 Destination: 1XXXXXX0798
Error 34: There is no spoon.
Source: XXXXXX2515 Destination: 1XXXXXX0798 Did: XXXXXX2515  Type: TFN

2010-01-07 11:01:49: billsecs: 17 billMin: 1 Source: XXXXXX2515 Destination: 011XXXXXXX41022
Error 34: There is no spoon.
Source: XXXXXX2515 Destination: 011XXXXXXX41022 Did: XXXXXX2515  Type: TFN

2010-01-05 11:20:24: billsecs: 7 billMin: 1 Source: XXXXXX0928 Destination: XXXXXX2515
Error 34: There is no spoon.
Source: XXXXXX0928 Destination: XXXXXX2515 Did: XXXXXX2515  Type: TFN

And, on with the code:

// If the call is incoming, just charge the trunk rate.
if ($thisCall['dst'] == $did && $type == "IAX") {
    $ldrate = 0;
    $location = "British Columbia";
    $calltype = "NALD";

if ($debug) print "Incoming call to IAX trunk.\n";

// Incoming calls to TFNs
} elseif ($thisCall['dst'] == $did && $type == "TFN") {

    $ldrate = 0;
    $location = "Toll-Free";
    $calltype = "NALD";

// If the call is outgoing, check to see if it's local
} elseif ($thisCall['src'] == $did) {

    // If the outgoing call is local, just charge the trunk rate
    // In this case, src is our customer, dst is remote end
    if (callIsLocal($thisCall['src'], $thisCall['dst'])) {
        $ldrate = 0;
        $location = "British Columbia";
        $calltype = "NALD";
    }

    // If the outgoing call is long distance, get the rate from the database
    else {
        $ratearr = getRate($thisCall['dst']);

        $ldrate = $ratearr['ldrate'];
        $location = $ratearr['location'];
        $calltype = $ratearr['calltype'];

        if ($debug) print "LDrate: $ldrate, Location: $location, Calltype: $calltype\n";
    }
} else {
    print "Error 34: There is no spoon.\n";
    print "Source: " . $thisCall['src'] . " Destination: " . $thisCall['dst'];
    print " Did: $did Type: $type\n ";
    continue;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:46:11+00:00Added an answer on May 13, 2026 at 3:46 pm

    I’d rather use var_dump() instead of print to display the content of the variables. Maybe there’s a leading/trailing whitespace that you’ve missed.

    else {
      print "Error 34: There is no spoon.\n";
      print "Source="; var_dump($thisCall['src']);
      print "Destination="; var_dump($thisCall['dst']);
      print "did="; var_dump($did);
      print "Type="; var_dump($type);
      continue;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 378k
  • Answers 378k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer http://www.iphonesampleapps.com/2009/12/adjust-uitextfield-hidden-behind-keyboard-with-uiscrollview/ May 14, 2026 at 9:20 pm
  • Editorial Team
    Editorial Team added an answer in viewDidLoad write self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate… May 14, 2026 at 9:20 pm
  • Editorial Team
    Editorial Team added an answer I hope i have now nearly understood what you want… May 14, 2026 at 9:20 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.